package com.bailian.snails;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author gaoxu
 * date: Created on 2021/5/31 下午1:39
 */
@SpringBootApplication
public class SnailsNacosConfigApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(SnailsNacosConfigApplication.class, args);
        String userName = applicationContext.getEnvironment().getProperty("common.name");
        String userAge = applicationContext.getEnvironment().getProperty("common.age");
        System.out.println("common name :" + userName + "; age: " + userAge);
    }
}
